<script type="text/javascript">
	$(document).ready(function(){/*
        $(':input[title]').each(function() {
            var $this = $(this);
            if($this.val() === '') {
                $this.val($this.attr('title'));
            }
            $this.focus(function() {
                if($this.val() === $this.attr('title')) {
                    $this.val('');
                }
            });
            $this.blur(function() {
                if($this.val() === '') {
                    $this.val($this.attr('title'));
                }
            });
        });
        $(":text").labelify();
        */
        	
	   $('#sm').click(function() {
            var name = $("#name").val();
            var email = $("#email").val();
            var phone = $("#phone").val();
            var address = $("#address").val();
            var comment = $("#comment").val();
            $.ajax({
                url: "http://localhost/phongkhamuytin/mod_phongkham/mod_phongkham/xulyform",
                type: "POST",
                cache: false,
                data: "name="+name+"&email="+email+"&phone="+phone+"&address="+address+"&comment="+comment,
                success: function(html){
                    $(".error").html(html);
                }
            });
            return false;
        });
        $(function(){ $("label").inFieldLabels(); });
    });
        
</script>

<div class="introch-inner"><?php 
    if (!empty($cauhoi)){?>
    <div class="name"><?php echo $user[0]->username;?></div>
    <div class="question"><p style="margin: 0;"><?php echo $cauhoi[0]->fulltext; ?></p>  </div>
    <div class="answer">
    <?php
        if ($cauhoi[0]->ans == 1){
            echo '<p class="title">Phòng khám trả lời:</p>';
            echo '<ul>';
                foreach($traloi as $tl){
                    echo '<li>'.$tl->content.'</li>';
                }
            echo '</ul>';
        }
        else{
            echo '<p class="title">Chưa có câu trả lời cho câu hỏi này.</p>';
        }
    echo '</div>';
    }else{
        echo 'Phòng khám hiện tại chưa nhận được câu hoi nào';
    }
    ?>
    
    <div class="comment">
    <?php if (!empty($binhluan)){
        echo '<p class="title">Bình luận:</p>';
        echo '<ul>';
        foreach($binhluan as $bl){
            echo '<li><p><strong>'.$bl->name.' : </strong>'.$bl->content.'</p></li>';
        }
        echo '</ul>';
        echo '<p style="font-weight:bold; color: #00f">phan trang</p>';
    }
    ?>
    
    </div>
    <?php 
    
    echo '<p class="title">Gửi bình luận:</p>';
    echo '<div class="error">';
    //echo validation_errors(); 
    echo empty($thongbao)?'':$thongbao;
    echo '</div>';
    $attributes = array('id' => 'sendcomment');
<<<<<<< .mine
    //echo form_open('',$attributes); 
=======
    echo form_open('',$attributes); 
    
>>>>>>> .r119
    ?>
<<<<<<< .mine
     <form action="#" id="sendcomment">
=======
     <fieldset>
>>>>>>> .r119
    <div class="fLeft" style="width:49%;" >
<<<<<<< .mine
        <input class="fLeft" type="text" id="name" name="name" title="Họ tên" value="<?php echo isset($_POST['name'])?$_POST['name']:'';?>" size="55" />
        <input class="fLeft" type="text" id="address" name="address" title="Địa chỉ" value="<?php echo isset($_POST['address'])?$_POST['address']:'';?>" size="55" />
=======
        <p class="fLeft" >
            <label for="name">Họ tên</label><br />
            <input type="text" id="name" name="name" title="Họ tên" value="<?php //echo isset($_POST['name'])?$_POST['name']:'';?>" size="50" />

        </p>
        <p class="fLeft" >
            <label for="address">Địa chỉ</label><br />
            <input type="text" id="address" name="address" title="Địa chỉ" value="" size="50" />
        </p>
>>>>>>> .r119
    </div>
        
<<<<<<< .mine
    <div class="fRight" style="width:49%;margin-right:2px">
        <input class="fRight" type="text" id="email" name="email" title="Email" value="<?php echo isset($_POST['email'])?$_POST['email']:'';?>" size="55" />
        <input class="fRight" type="text" id="fone" name="fone" title="Điện thoại" value="<?php echo isset($_POST['fone'])?$_POST['fone']:'';?>" size="55" />
    </div>
    <div class="fLeft" style="width:100%">
        <textarea rows="5" name="noidung" id="noidung" cols="120"><?php echo isset($_POST['noidung'])?$_POST['noidung']:'';?></textarea>
    </div>
=======
    <div class="fRight" style="width:49%">
        <p class="fRight">
            <label for="email">Email</label><br />
            <input type="text" id="email" name="email" title="Email" value="" size="50" />
        </p>
        <p class="fRight">
            <label for="phone">Điện thoại</label><br />
            <input type="text" id="phone" name="phone" title="Điện thoại" value="" size="50" />
        </p>
     </div>
    <div class="fLeft" style="width:660px">
        <p>
            <label for="comment">Nội dung bình luận</label><br />
            <textarea rows="10" id="comment" name="comment" cols="100"></textarea>
        </p>
            </div>
    </fieldset>
>>>>>>> .r119
    <div class="fLeft">
        <input id="sm" type="submit" value="Gửi thông tin" />
        <input type="reset" value="Nhập lại" />
    </div>
    
    </form>
</div>